package com.xinbo.tuiyousuper;




import com.xinbo.tuiyousuper.utils.PreferenceUtils;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

public class LanchActivity extends Activity
{
	private ImageView mImageView;
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_lanch);
		mImageView = (ImageView) findViewById(R.id.imageView_lauch);
		Animation animation = AnimationUtils.loadAnimation(LanchActivity.this,
		        R.anim.logo_anima);
		mImageView.setAnimation(animation);
		mImageView.postDelayed(new Runnable()
		{

			@Override
			public void run()
			{
				boolean guide = PreferenceUtils.getGuide(LanchActivity.this);
				if (!guide)
                {
					startActivity(new Intent(LanchActivity.this,
							ToNewGuidMainActivity.class));
                }else {
                	startActivity(new Intent(LanchActivity.this,
                			MainFragmentTabs.class));
				}
				finish();
			}
		}, 4000);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu)
	{
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.lanch, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item)
	{
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings)
		{
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
